import { createStore } from 'vuex'

// 保持状态信息，比如用户的登录信息

export default createStore({
  state: {
    isLogin: false
  },
  getters: {
  },
  mutations: {
    initializeStore(state){
      if (localStorage.getItem('token')){
        state.isLogin = true
      }
      else{
        state.isLogin = false
      }
    },
    setLoginStatus(state, status){
      state.isLogin = status
    }
  },
  actions: {
  },
  modules: {
  }
})
